const formatTime = function () {
    return `[${new Date().toLocaleTimeString()}]`
}
const store = {
    state: {
        code:
            `${formatTime()} 初始化完毕
`,
        runResult:
            ``
    },
    mutations: {
        SET_CODE: (state, code) => {
            state.code = state.code + `${formatTime()} ${code}
`
        },
        SET_RUN_RESULT: (state, runResult) => {
            state.runResult = state.runResult + `${runResult}
`
        },
        CLEAR_CODE: (state, code) => {
            state.code = `${formatTime()} 初始化完毕`
        },
        CLEAR_RUN_RESULT: (state, code) => {
            state.runResult = ``
        }
    },
};

export default store;
